

FIND FIRST qad_wkfl EXCLUSIVE-LOCK WHERE qad_key1 = "DataSync" AND qad_key2 = "pt_mstr" NO-ERROR.
IF NOT AVAILABLE qad_wkfl THEN DO:
    CREATE qad_wkfl.
    ASSIGN
        qad_key1 = "DataSync"
        qad_key2 = "pt_mstr"
        qad_datefld[1] = today - 1.
END.
ELSE
    ASSIGN
        qad_datefld[1] = today - 1.

/******************************************************************************************************/

FIND FIRST qad_wkfl EXCLUSIVE-LOCK WHERE qad_key1 = "DataSync" AND qad_key2 = "ptp_det" NO-ERROR.
IF NOT AVAILABLE qad_wkfl THEN DO:
    CREATE qad_wkfl.
    ASSIGN
        qad_key1 = "DataSync"
        qad_key2 = "ptp_det"
        qad_datefld[1] = today - 1.
END.
ELSE
    ASSIGN
        qad_datefld[1] = today - 1.

/******************************************************************************************************/

FIND FIRST qad_wkfl EXCLUSIVE-LOCK WHERE qad_key1 = "DataSync" AND qad_key2 = "cm_mstr" NO-ERROR.
IF NOT AVAILABLE qad_wkfl THEN DO:
    CREATE qad_wkfl.
    ASSIGN
        qad_key1 = "DataSync"
        qad_key2 = "cm_mstr"
        qad_datefld[1] = today - 1.
END.
ELSE
    ASSIGN
        qad_datefld[1] = today - 1.

/******************************************************************************************************/

FIND FIRST qad_wkfl EXCLUSIVE-LOCK WHERE qad_key1 = "DataSync" AND qad_key2 = "vd_mstr" NO-ERROR.
IF NOT AVAILABLE qad_wkfl THEN DO:
    CREATE qad_wkfl.
    ASSIGN
        qad_key1 = "DataSync"
        qad_key2 = "vd_mstr"
        qad_datefld[1] = today - 1.
END.
ELSE
    ASSIGN
        qad_datefld[1] = today - 1.

